package com.ruoyi.keep.service.impl;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.keep.mapper.SelfishCourseEvaluateMapper;
import com.ruoyi.keep.domain.SelfishCourseEvaluate;
import com.ruoyi.keep.service.ISelfishCourseEvaluateService;

/**
 * 私课评价管理Service业务层处理
 * 
 * @author yipeng
 * @date 2024-08-15
 */
@Service
public class SelfishCourseEvaluateServiceImpl implements ISelfishCourseEvaluateService 
{
    @Autowired
    private SelfishCourseEvaluateMapper selfishCourseEvaluateMapper;

    /**
     * 查询私课评价管理
     * 
     * @param id 私课评价管理主键
     * @return 私课评价管理
     */
    @Override
    public SelfishCourseEvaluate selectSelfishCourseEvaluateById(Long id)
    {
        return selfishCourseEvaluateMapper.selectSelfishCourseEvaluateById(id);
    }

    /**
     * 查询私课评价管理列表
     * 
     * @param selfishCourseEvaluate 私课评价管理
     * @return 私课评价管理
     */
    @Override
    public List<SelfishCourseEvaluate> selectSelfishCourseEvaluateList(SelfishCourseEvaluate selfishCourseEvaluate)
    {
        return selfishCourseEvaluateMapper.selectSelfishCourseEvaluateList(selfishCourseEvaluate);
    }

    /**
     * 新增私课评价管理
     * 
     * @param selfishCourseEvaluate 私课评价管理
     * @return 结果
     */
    @Override
    public int insertSelfishCourseEvaluate(SelfishCourseEvaluate selfishCourseEvaluate)
    {
        // 获取当前日期时间
        LocalDate now = LocalDate.now();
        Date nowDate = java.sql.Date.valueOf(now);
        selfishCourseEvaluate.setTime(nowDate);



        return selfishCourseEvaluateMapper.insertSelfishCourseEvaluate(selfishCourseEvaluate);
    }

    /**
     * 修改私课评价管理
     * 
     * @param selfishCourseEvaluate 私课评价管理
     * @return 结果
     */
    @Override
    public int updateSelfishCourseEvaluate(SelfishCourseEvaluate selfishCourseEvaluate)
    {
        return selfishCourseEvaluateMapper.updateSelfishCourseEvaluate(selfishCourseEvaluate);
    }

    /**
     * 批量删除私课评价管理
     * 
     * @param ids 需要删除的私课评价管理主键
     * @return 结果
     */
    @Override
    public int deleteSelfishCourseEvaluateByIds(Long[] ids)
    {
        return selfishCourseEvaluateMapper.deleteSelfishCourseEvaluateByIds(ids);
    }

    /**
     * 删除私课评价管理信息
     * 
     * @param id 私课评价管理主键
     * @return 结果
     */
    @Override
    public int deleteSelfishCourseEvaluateById(Long id)
    {

        return selfishCourseEvaluateMapper.deleteSelfishCourseEvaluateById(id);
    }
}
